package com.example.demo.niuke;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;

/**
 * @Description: HUAWEI机试 删除字符串中出现次数最少的字符
 * @Author: LLL
 * @Date: 2020-03-21 16:41
 **/
public class Main18 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            String[] split = line.split("");
            HashMap<String, Integer> map = new HashMap<>();
            for (String s : split) {
                if (map.containsKey(s)) {
                    map.put(s, map.get(s) + 1);
                } else {
                    map.put(s, 1);
                }
            }
            //            for (Map.Entry<String, Integer> entry : map.entrySet()) {
            //                if (entry.ge)
            //            }
            //            List<Integer> collection = (List<Integer>) map.values();
            //            Collections.sort(collection);
            //            System.out.println(map);
            //            Integer[] ts = collection.toArray(new Integer[collection.size()]);
            //            List<Integer> dels = new ArrayList<>();
            //            int index = 0;
            //            for (int i = 0; i < ts.length; i++) {
            //                while (ts[i].equals(ts[i + 1])) {
            //
            //                }
            //                index = i;
            //            }

            Collection<Integer> al = map.values();
            int index = Collections.min(al);
            StringBuffer sb = new StringBuffer("");
            for (String c : split) {
                if (map.get(c) != index)
                    sb.append(c);
            }
            System.out.print(sb.toString());
            System.out.println();
        }

    }

}
